#include "setback.h"

setBack::setBack(QGraphicsPixmapItem *parent) : QGraphicsPixmapItem(parent)
{

}
setBack::setBack(QPoint _pos,QPixmap _pixmap,int setbackType)
{
    this->setPos(_pos);
    this->setPixmap(_pixmap);
    this->SB_type = setbackType;
    SbSpeed = 6;

}

void setBack::setBackMove(QPoint _dir)
{
    this->moveBy(_dir.x()*SbSpeed,_dir.y()*SbSpeed);
}

setBack::setbackType setBack::getSetbackType() const
{
     if(SB_type == 0)
     {
         return setBack::setbackType::SB_bullet;
     }
     else if(SB_type == 1)
     {
         return setBack::setbackType::SB_platform;
     }
     else if(SB_type == 2)
     {
         return setBack::setbackType::SB_fence;

     }
}
